Copyright: ® Bernd Beekes


Help Contents
Contents

General Description

Introduction

How To Use VB/Expand

Customizing The Control File

Sample Control File

Keyword Description


Introduction

VB/Expand is intended to be a small, but powerful add on to the Visual Basic Environment. With VB/Expand, the following features are only one keystroke away:

•	Instant access to help and text files.

•	Automatic Insertion of  (user defined) headers for forms, modules, subroutines and functions.

•	Inclusion and Exclusion of other files.

•	Open Interface to Code Generation Tools.

Related Topics:

Installation


Installation

To install and use VB/Expand, simply copy VBEXPAND.EXE and the control file VBEXPAND.CTL in the same directory.  You may want to adapt the control file to your personal preferences. For information on how to do this, see Sample Control File and Keyword Description.

To use VB/Expand, you may start it as any other Windows programm, but we have found it quite comfortable to use the tool as follows (with Windows 3.1):

•	Place VB/Expand in the startup group.

•	Change the properties to "Start Minimized".

•	Assign a Hot Key to the program (e.g. SHIFT+ALT+A).

Now, whenever you need assistance from VB/Expand, simply press the Hot Key combination, and your little helper pops up.


How To Use VB/Expand

Most times, when you need assistance from VB/Expand, you will be in the Visual Basic environment. There may a be situations, where you want to access the help and text files outside VB, but for all other functions it is expected, that Visual Basic is running, with a Code Window currently active.

Related Topics:

Help And Text Files

Documentation Headers

Include / Exclude

Insert Code / New Module


Help And Text Files

To access a help or text file, simpy let VB/Expand pop up and select the corresponding entry in one of the list boxes.


Documentation Headers

To insert a header template for a form or module, a code window for this object has to be open and active. To insert the template, move to the declarations section, activate VB/Expand and press the corresponding push button. Now the template is inserted into your code, and a Search operation for the word STOP is automatically invoked. This allows you to complete the template by overwriting the placeholder and using F3 to step from one of these placeholders to the next.

Headers for functions and subroutines are inserted in the same way. But instead of positioning to the declarations section, you will move to the beginning of the procedure in question.


Include / Exclude

Many people like the REM $INCLUDE statement of DOS Basic. VB/Expand brings this functionality to Visual Basic. To define an include file, simply put the following two lines into your source code:

'BEGIN_INCLUDE <FILENAME>
'END_INCLUDE

Here is an example on how to include the standard definition file CONSTANT.TXT (we do not recommend to include the complete definition file in your source code):

'BEGIN_INCLUDE <C:\VB\CONSTANT.TXT>
'END_INCLUDE

To include the file, activate VB/Expand and press the Include button. To remove the inserted code use Exclude.

Related Topics:

What you should remember:


What you should remember:

•	You must have a code window open to use the Include function.

•	The Include/Exclude service processes ALL include statements in the active module.

•	It is a good idea to save a module before including or excluding files.


Insert Code / New Module

These two buttons allow the integration of  a code generation tool into the Visual Basic environment. Pressing one of these buttons starts the code generator with a temporary filename as a command line parameter. The called program is expected to store the generated code in that file, from where it is inserted at the current cursor position or into a new module. For more information see Sample Control File and Keyword Description. If there is no code generation tool defined, these buttons are automatically disabled.

It is strongly recommended to save the project before starting code generation.


Sample Control File

VBEXPAND.CTL adapts the program to your personal preferences. For an explanation of each keyword see Keyword Description.

HELP=VB Help,d:\vb2\vb
HELP=VB API,d:\vb2\cdk\vbapi
HELP=VB Control Ref,d:\vb2\ctrlref
HELP=VB Knowledge,d:\vb2\vbknowlg
HELP=VB Tips,d:\vb2\tips\vb-tips
HELP=Win SDK 3.1,d:\vb2\winapi\win31wh
HELP=Win API,d:\vb2\winapi\win31api
HELP=WIN Tips,c:\c7\bin\tips
HELP=ODBC Reference,d:\odbc\sdk\odbcapi

TEXT=VB Constants,notepad d:\vb2\constant.txt
TEXT=VSQL definitions,notepad d:\vsql\hdrvsql.bas
TEXT=DD creation script,notepad d:\vbxpress\scp\dd.scp
TEXT=WINDOWS.H,em.bat c:\c7\include\windows.h
TEXT=VBAPI.H,em.bat d:\vb2\cdk\vbapi.h
TEXT=SQL.H (Gupta),em.bat d:\gupta\inc\sql.h
TEXT=SQL.H (ODBC),em.bat d:\odbc\sdk\include\sql.h
TEXT=SQLEXT.H (ODBC),em.bat d:\odbc\sdk\include\sqlext.h
TEXT=ERROR.SQL (Gupta),em.bat d:\gupta\error.sql

VBPGM=Microsoft Visual Basic

SEARCHCMD=%EF
SAVECMD=%FT
LOADCMD=%FL
REPLACECMD=%R
MERGECMD=%M
NEWCMD=%W
CODEGEN=DemoGen

FORM='-------------------------------------------------------------------------------
FORM='
FORM=' FORM:     fmSTOP
FORM='
FORM=' AUTHOR:   Bernd Beekes
FORM='
FORM=' HISTORY:  &DATE:  start of initial version
FORM='
FORM=' PURPOSE:  STOP
FORM='
FORM=' COMMENT:  STOP
FORM='
FORM='-------------------------------------------------------------------------------
FORM=

MODULE='-------------------------------------------------------------------------------
MODULE='
MODULE=' MODULE:   STOP
MODULE='
MODULE=' AUTHOR:   Bernd Beekes
MODULE='
MODULE=' HISTORY:  &DATE:  start of initial version
MODULE='
MODULE=' PURPOSE:  STOP
MODULE='
MODULE=' COMMENT:  STOP
MODULE='
MODULE='-------------------------------------------------------------------------------
MODULE=

SUB='
SUB=' SUB:      STOP
SUB='
SUB=' PURPOSE:  STOP
SUB='
SUB=' PARAMS:   STOP
SUB='
SUB=' COMMENT:  STOP
SUB='

FUNC='
FUNC=' FUNCTION: STOP
FUNC='
FUNC=' PURPOSE:  STOP
FUNC='
FUNC=' PARAMS:   STOP
FUNC='
FUNC=' RETURN:   STOP
FUNC='
FUNC=' COMMENT:  STOP
FUNC='


Keyword Description

HELP=Item Name, Help File

TEXT=Item Name,Editor Command

VBPGM=Microsoft Visual Basic

SEARCHCMD=%EF

SAVECMD=%FT

LOADCMD=%FL

REPLACECMD=%R

MERGECMD=%M

NEWCMD=%W

CODEGEN=Tool Name

FORM=..., MODULE=..., SUB=..., FUNC=...


HELP=Item Name, Help File

These lines define the items, which are expected to be displayed in the Help Listbox. VB/Expand simply starts the WINHELP application with the given name.


TEXT=Item Name,Editor Command

Use these lines to define the text files, you want to view or edit from VB/Expand.


VBPGM=Microsoft Visual Basic

This line is used to identify the Visual Basic application.


SEARCHCMD=%EF

Defines the keystrokes used to invoke the FIND operation (SendKeys format).


SAVECMD=%FT

Keystrokes to invoke the SAVE command.


LOADCMD=%FL

Keystrokes to invoke the LOAD TEXT command.


REPLACECMD=%R

Access key for the REPLACE button in the Load Text dialog.


MERGECMD=%M

Access key for the MERGE button in the Load Text dialog.


NEWCMD=%W

Access key for the NEW button in the Load Text dialog.


CODEGEN=Tool Name

Definition of a code generation tool. This tool has to store the generated code in a temporary file. The name of this file is passed to the code generator as a command line parameter. The VB/Expand distribution contains a sample code generator (DEMOGEN.EXE) to demonstrate the functionality.


FORM=..., MODULE=..., SUB=..., FUNC=...

These lines define header templates for forms, modules, subroutines and functions. Use STOP placeholders to step through the template with the F3 key after it is inserted. The &DATE keyword is replaced with the current date during insertion.


VB/Expand: 'Assistance at your fingertips'